package com.liuhui;

import com.common.lambda.Animal;
import org.omg.Messaging.SyncScopeHelper;

import javax.swing.plaf.synth.SynthSpinnerUI;
import java.lang.reflect.Member;
import java.util.function.Function;

public class LambdaTest {
    public static void main(String[] args) {
//        LambdaTest test = new LambdaTest();
//
//        test.method();
//
//        test.method1();
//        test.method2();
//        test.method3();
//        test.method4();
        //类型：类型·就是·语法·1规定之一
        //变量：用户自定义的  类型 变量 = 值
        //int 是·代表数字
        //String 代表一句话·
        //double  代表小数
        //+ - * /  %

        //字面量：直接写出来的

//                              int  age  = asdasdas;
                             String  asdasda = "军人·今天嗷嗷·";
                             double d = 1.21;

//        System.out.println(age * 12 - 9);
        System.out.println(asdasda);
        System.out.println(d);



    }

    void method(){
        Function<String,String> fun =(String s)-> {
                return s;
        };
        System.out.println("test:"+fun.apply("clear"));

    }

    void method1(){
        Dog dog =new Dog();
        dog.info();
    }

    void method2(){
        Animal animal =new Animal() {
            @Override
            public void info() {
                System.out.println("this is a dog2");
            }
        };
        animal.info();
    }

    void method3(){
        Animal animal = ()->{
            System.out.println("this is a dog3");
        };
        animal.info();
    }

    void method4(){
        Animal animal =()-> System.out.println("this is a dog4");
        animal.info();

    }



}

class Dog implements Animal{

    @Override
    public void info() {
        System.out.println("this is a dog !!!");
    }
}
